package cn.com.nes.site.controller.crm.opportunity.vo;

import cn.com.nes.site.entity.em.crm.opportunity.OpportunityStageEnum;
import cn.com.nes.site.entity.vo.BaseVO;
import cn.com.nes.site.service.crm.opportunity.bo.OpportunityBO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.beans.BeanUtils;

@ApiModel(value = "商机成交入参模型")
@Data
public class OpprotuniySuccessVO extends BaseVO {

    @ApiModelProperty(value = "商机UUID", required = true)
    @NotBlank(message = "商机UUID")
    private String opportunityUuid;

    public OpportunityBO convertToBo() {
        OpportunityBO bo = new OpportunityBO();
        BeanUtils.copyProperties(this, bo);
        bo.setUuid(this.opportunityUuid);
        bo.setOpportunityStage(OpportunityStageEnum._transaction);
        return bo;
    }

}
